package leetcode;

import java.util.HashSet;

public class Pro0104 {

    public static void main(String[] args) {
        System.out.println(canPermutePalindrome("tactcoabg"));
    }

    public static boolean canPermutePalindrome(String s) {
        HashSet<Character> set = new HashSet<>();
        for (char c : s.toCharArray()) {
            if (!set.add(c)) {
                set.remove(c);
            }
        }
        return set.size() <= 1;
    }
}
